/*
 * @Author: whq
 * @Date: 2022-11-09 15:43:37
 * @LastEditTime: 2023-04-12 22:11:12
 * @LastEditors: whq
 * @Description: 
 * @FilePath: \pc-web-zjalny\src\store\globals.ts
 */
import { defineStore } from 'pinia'

type ModelerStore = {
    info: any,
    language: any,
}

const defaultState: ModelerStore = {
    info: 'pinia 可以使用',
    language: null,
}

export default defineStore('globals', {
    persist: true,//开启数据持久化
    state: () => defaultState,
    getters: {
        getInfo: (state) => state.info,
        getLanguage: (state) => state.language,
    },
    actions: {
        setInfo(data: any) {
            this.info = data
        },
        setLanguage(data: any) {
            this.language = data
        },
    }
})
